home *** CD-ROM | disk | FTP | other *** search
- # HookUp Login Script - PPP
-
- # Always place a comment as the first line with the name of the provider
- # and the type of connection. We will attempt to display this in the
- # script file requestor to aid the user in selecting an appropriate
- # script since the filename may not be sufficient.
-
- #define the variables we will need
-
- STRING username
- STRING password
- STRING framing
- STRING IPAddress
-
- # uncomment for debugging
-
- # TRACE ON
-
- # reset maximum login timeout. We put this here in case it took an
- # unusually long amount of time to get the initial connection. Its
- # probably too long but its better to be safe then sorry.
-
- SetTimeout 90
-
- # Get username from access method
-
- # NOTE: Some systems do not require a username.
-
- # This step will not be necessary in those cases.
-
- CfgGetValue "Username" username
- # if the Username field is empty, prompt the user for it.
- IF result = 0 THEN
- GetInput "Enter your user name" username
- IF result = 0 THEN
- PRINT "Warning, no username entered"
- ELSE
- PRINT "Username set to ["; username; "]"
- ENDIF
- ENDIF
-
- # get password from access method
-
- # NOTE: Some systems do not require a password.
-
- # This step will not be necessary in those cases.
-
- CfgGetValue "Password" password
- # if the Password field is empty, prompt the user for it.
- IF result = 0 THEN
- GetPassword "Enter your password" password
- IF result = 0 THEN
- PRINT "Warning, no password entered"
- ELSE
- # NOTE: Don't print password.
- PRINT "Password set."
- ENDIF
- ENDIF
-
- # get framing layer (MPPPP, MPSLIP)
- CfgGetValue "Framing" framing
-
- # abort with an error if we can't read the Framing setting
- IF result = 0 THEN
- ABORT "Can't read 'Framing' setting from qdeck.ini"
- ENDIF
-
- CommWaitFor "login:" # wait for login prompt
- CommSend username # send user name
- CommSend "%r" # send carriage return
- CommWaitFor "Password:" # wait for password prompt
- CommSend password # send password
- CommSend "%r" # send carriage return
-
- # if SLIP, we need to get the IP address
- IF framing = "MPSLIP" THEN
- CommWaitFor "choice:"
- Delay 2
- CommSend "2%r"
- PRINT "SLIP Selected"
- ENDIF # END of SLIP logic
-
- # if PPP, no need and go
- IF framing = "MPPPP" THEN
- CommWaitFor "choice:"
- Delay 2
- CommSend "3%r"
- PRINT "PPP Selected"
- ENDIF
-
- CommWaitFor "dress:"
- CommReadIPAddr IPAddress
- IF result < 7 THEN # IP Address length test
- ABORT "Missing or invalid IP Address."
- ENDIF
- CfgSetValue "IPAddress" ipaddress
- PRINT "IP Address set to:"; ipaddress
-
- END # indicate success IF we got this far
-